Fix infinite loop when nest selection runs non-interactively#7
Fix infinite loop when nest selection runs non-interactively#7tylerthecoder wants to merge 2 commits intomainfrom
Conversation
When running `owl nest all` via curl pipe (e.g., the quick start command), stdin is not a terminal. The nest selection loop would read empty strings from EOF repeatedly, causing "Invalid selection" to spam forever. Now detects non-interactive stdin and exits with a helpful message directing users to run `owl nest switch` manually. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The setup.sh script now redirects stdin from /dev/tty when calling `owl nest all`, allowing interactive nest selection even when the script is piped from curl. Also improves the Rust fallback error message to show the /dev/tty workaround. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| if !std::io::stdin().is_terminal() { | ||
| eprintln!( | ||
| "{}", | ||
| "No nest configured and stdin is not interactive.".red() |
There was a problem hiding this comment.
Error message incorrectly claims no nest is configured
Low Severity
The error message "No nest configured and stdin is not interactive" is misleading when switch_nest() is called via owl nest switch with an existing nest configured. In this case, get_nest() succeeds (returning the current nest), then switch_nest() is called explicitly for switching. The TTY check fails, but the message incorrectly states "No nest configured" when a nest actually is configured. The message text doesn't accurately reflect all code paths that can trigger it.


Summary
/dev/ttyto allow interactive nest selection even when pipedProblem
When running:
curl https://raw.githubusercontent.com/tylerthecoder/owl/main/setups/owl/setup.sh | bashThe script calls
owl nest allat the end. On a fresh machine with no nest configured, this triggers interactive nest selection. But since stdin is consumed by the curl pipe,read_linereturns empty strings repeatedly, causing an infinite loop of "Invalid selection" messages.Solution
setup.shnow runsowl nest all < /dev/ttywhich redirects stdin from the terminal device, bypassing the curl pipeTest plan
curl ... | bashon a fresh machine - should prompt for nest selection interactively🤖 Generated with Claude Code